<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>会员跟进</title>
    <meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0.maximum-scale=1.0,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/homePage.css">
    <link rel="stylesheet" href="css/flexible.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@2.2/lib/index.css">
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/flexible.js"></script>
    <script src="js/vue.js"></script>
    <script src="js/MD5.js"></script>
    <script src="js/qs.js"></script>
    <script src="js/axios.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vant@2.2/lib/vant.min.js"></script>
</head>
<body>
<div class="container_box" id="app">
    <div class="Information_entry">
        <label class="lf">跟进方式</label>
        <div class="rf message padding14">
            <select v-model="from.Ftype">
                <option v-for="item in Ftype" :value="item.id">
                    {{item.name}}
                </option>
            </select>
        </div>
    </div>
    <div class="remark">
        <label class="lf">跟进内容</label>
        <div class="lf width75">
            <textarea v-model="from.Info" rows="6" maxlength="40" placeholder="请输入跟进内容"></textarea>
        </div>
    </div>
    <div class="save" @click="save">
        <button type="button">保存</button>
    </div>
</div>
</body>
<script>
new Vue({
    el: '#app',
    data: {
        from:{
            Uid:'1',
            Ftype:"0",
            Info:""
        },
        Ftype:[
            {
                name:'电话',
                id:'0'
            },
            {
                name:'微信',
                id:'1'
            },
            {
                name:'QQ',
                id:'2'
            },
            {
                name:'短信',
                id:'3'
            },
            {
                name:'面谈',
                id:'4'
            },
        ],
    },
    created(){
        this.setCanS()
    },
    methods:{
        //设置参数
        setCanS(){
            let Request = new Object()
            Request = GetRequest()
            this.from.Uid = Request['uid']
        },
        //获取信息
        save(){
            let from =JSON.stringify(this.from)
            let sign=md5(from)
            const params={
                from:from,
                sign:sign
            }
            getVs()
            axios.post('/mobileapi/adviser/customer.php?act=add_follow',Qs.stringify(params)).then(data =>{
                console.log(data.data)
                let { msg, code,user} = data.data
                    if (code !== 200) {
                        window.vant.Toast.fail('添加跟进失败')
                    } else {
                        data=data.data
                        window.vant.Toast.success('添加跟进成功')
                        this.timer = setTimeout(this.list, 2000);
                    }
                }).catch(function (error) { 
                    console.log(error); 
            });
        },
        list(){
            window.location.href='memberDetails.html?uid='+this.from.Uid+''
        }
    }
})
</script>
</html>